Repository navigation
fix(mcp-server-supabase): keep verify_jwt on redeploy when the call leaves it out - #682
mateusvoc13 wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. Summary
Change: Bug fix · Severity of issue fixed: Medium Merge Risk:
|
…eaves it out deploy_edge_function defaulted verify_jwt to true in the tool schema, so a redeploy without the flag turned JWT verification back on for functions that had it off, such as webhooks that check their own signature. verify_jwt is now optional. When it's left out, the deploy reads the function's current setting and keeps it. A 404 means a new function, which defaults to true. Any other lookup error stops the deploy. Fixes supabase#681
f9ef1dc to
c61626d
Compare
What kind of change does this PR introduce?
Bug fix
What is the current behavior?
Fixes #681
deploy_edge_functiondefaultsverify_jwttotruein the tool schema, so a redeploy that leaves the flag out turns JWT verification back on for a function that had it off. A webhook that checks its own signature then starts getting 401s. The tool description already asks the agent to keep the old setting, but the agent can't see it without aget_edge_functioncall, and the schema default overrides it when it doesn't make one.What is the new behavior?
verify_jwtis optional in the tool schema, with no default. The description now says to leave it out to keep the current setting.deployEdgeFunctionreads the function's current setting and keeps it.true. The secure default for new functions doesn't change.trueorfalse.verify_jwt: falseverify_jwtleft outtruefalseverify_jwt: truetruetrueverify_jwtleft out, lookup returns 500trueverify_jwtleft outtruetrueThis changes the tool definition (
verify_jwtloses its default). Flagging it given #467 and the OpenAI plugin scanner.How to Review
Deploy path
packages/mcp-server-supabase/src/platform/api-platform.tsdeployEdgeFunction. It only runs whenverify_jwtis undefined. It uses its own metadata call instead of the existingtry/catch, so a failed lookup can't turn into a silenttrue.Tool schema
packages/mcp-server-supabase/src/tools/edge-function-tools.ts.default(true)becomes.optional(), and the description is updated.Tests
packages/mcp-server-supabase/src/server.functions.test.tsverify_jwtkeeps itfalse. A 500 on the lookup stops the deploy and leaves the function's setting unchanged.Review questions
verify_jwt?Verification
main(expected true to be false) and passes with the fix.vitest --project unit: 40 files, 1192 tests pass.tsc --noEmitandbiome checkclean on the changed files.